Skip to content

Conversation

@mfiedorowicz
Copy link
Member

This pull request introduces OAuth2-based authentication to the Diode SDK, replacing the previous API key mechanism. It also includes updates to the supported entities, dependency requirements, and test cases. Below is a summary of the most important changes grouped by theme.

Authentication Updates

  • Replaced the API key-based authentication with OAuth2 client credentials. Introduced _DiodeAuthentication and _authenticate methods to handle token retrieval and metadata updates. (netboxlabs/diode/sdk/client.py) [1] [2]
  • Added new environment variables DIODE_CLIENT_ID and DIODE_CLIENT_SECRET for OAuth2 credentials. (README.md, netboxlabs/diode/sdk/client.py) [1] [2]

Retry Mechanism

  • Implemented retry logic for ingestion requests in case of UNAUTHENTICATED errors, with a configurable maximum number of retries (DIODE_MAX_AUTH_RETRIES). (netboxlabs/diode/sdk/client.py)

Documentation and Supported Entities

  • Updated the list of supported entities in the README.md to include a comprehensive set of object types. (README.md)
  • Clarified the usage of OAuth2 credentials in the documentation. (README.md)

Dependency Updates

  • Updated dependencies in pyproject.toml to allow more flexible versioning for certifi, grpcio, and grpcio-status. (pyproject.toml)

Test Suite Enhancements

  • Refactored test cases to validate the new OAuth2-based authentication flow and removed tests related to the deprecated API key mechanism. (tests/test_client.py) [1] [2]

These changes significantly enhance the SDK's authentication mechanism, improve its documentation, and ensure robust testing for the new features.

ltucker and others added 30 commits March 19, 2025 15:34
Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
@mfiedorowicz mfiedorowicz self-assigned this Apr 23, 2025
@github-actions github-actions bot added dependencies Pull requests that update a dependency file markdown python internal labels Apr 23, 2025
@github-actions
Copy link

github-actions bot commented Apr 23, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
/opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/site-packages/netboxlabs/diode/sdk
   client.py190498%81, 256, 310, 338
TOTAL222498% 

Tests Skipped Failures Errors Time
93 0 💤 0 ❌ 0 🔥 1.127s ⏱️

Copy link
Contributor

@leoparente leoparente left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@mfiedorowicz mfiedorowicz merged commit 6f7070d into develop Apr 23, 2025
6 checks passed
@mfiedorowicz mfiedorowicz deleted the update_datamodel branch April 23, 2025 20:53
@github-actions
Copy link

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file internal markdown python released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants